//简单的用户登陆界面
/**login.java**/
public class login {
	private String uaserName;
	private String password;
	//不带参
	public login() {
		
	}
	
	public String getUaserName() {
		try{
			byte b[]=uaserName.getBytes("ISO-8859-1");
			uaserName=new String(b,"UTF-8");//字节码转换为编码		
		}catch(Exception e){
			e.printStackTrace();
		}
		return uaserName;
	}
	public void setUaserName(String uaserName) {
		this.uaserName = uaserName;
	}
	
	public String getPassword() {
		try{
			byte b[]=password.getBytes("ISO-8859-1");
			password=new String(b,"UTF-8");//字节码转换为编码		
		}catch(Exception e){
			e.printStackTrace();
		}
		return password;
	}
	public void setPassword(String password) {
		this.password = password;
	}
	
}
/**login.jsp**/
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <title>登陆</title>  
	<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
  </head>
  
  <body>
    <h3>登陆系统</h3>
    <hr>
    <form method="post"action="welcome.jsp">
    <p>用户名：<input type="text"name="uaserName"></p>
    <p>密码：<input type="text"name="password"></p>
    <p><input type="submit"value="确定">&nbsp;&nbsp;&nbsp;&nbsp;
    <input type="reset"value="重置"></p>
    </form>
  </body>
</html>
/**welcome.jsp**/
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<jsp:useBean id="login"scope="session"class="JavaBean.login">
</jsp:useBean>
<jsp:setProperty name="login"property="*"/>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>  
    <title><%=login.getUaserName() %>欢迎</title> 
	<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
  </head>
  <body>
    <h3><jsp:getProperty property="uaserName"name="login"/>,欢迎光临
    </h3>
    <hr>
    <p>用户名：<%=login.getUaserName() %></p>
    <p>密码：<%=login.getPassword() %></p>   
  </body>
</html>
